package com.platform.system.enums;

public enum PayStatusEnum {
    WAIT_PAY(0, "待支付"),
    FINISHED_PAY(1, "完成支付"),
    CANCELED_PAY(2, "关闭支付"),
    FAILED_PAY(3, "失败支付"),
    AMOUNT_ERROR(4, "支付金额错误");

    private final int code;
    private final String descp;

    PayStatusEnum(int code, String descp) {
        this.code = code;
        this.descp = descp;
    }

    public int getCode() {
        return code;
    }

    public String getDescp() {
        return descp;
    }

    public static PayStatusEnum of(Integer code) {
        for (PayStatusEnum item : PayStatusEnum.values()) {
            if (item.getCode() == code) return item;
        }
        return null;
    }
}
